package stub.logicsvStub;

import resultmessage.CourseProduceRM;
import vo.CourseAssistVO;
import vo.CourseBasicVO;
import vo.CoursePublishVO;
import logicsv.courseProduce_logicsv.CourseProduceLogicsv;

public class CourseProduceLogicsvStub implements CourseProduceLogicsv {
	CourseBasicVO courseBasicVO;
	CoursePublishVO coursePublishVO;
	CourseAssistVO courseAssistVO;
	
	public CourseProduceLogicsvStub(CourseBasicVO courseBasicVO, 
			CoursePublishVO coursePublishVO,CourseAssistVO courseAssistVO){
		courseBasicVO = this.courseBasicVO;
		coursePublishVO = this.coursePublishVO;
		courseAssistVO = this.courseAssistVO;
		
	}
	@Override
	public CourseProduceRM addCourseBasic(String courseID, String courseName,
			int headCredit, int tailCredit, int credit, int semester,
			String campus, String collegeID, String majorID, int maxStudentNum) {
		// TODO Auto-generated method stub
		if(courseID.equals(null)||courseName.equals(null)||campus.equals(null)
				||collegeID.equals(null)||majorID.equals(null)){
			return CourseProduceRM.INFO_BLANK;
		}
		else if(headCredit<tailCredit||tailCredit<=0||credit>headCredit||credit<tailCredit){
			return CourseProduceRM.CREDIT_EXCEPTION;
		}
		else if(maxStudentNum<=0){
			return CourseProduceRM.STUDENTNUM_EXCEPTION;
		}
		else if(semester<=0){
			return CourseProduceRM.SEMESTER_EXCEPTION;
		}
		return CourseProduceRM.SUCCESS;
	}

	@Override
	public CourseProduceRM updateCourseBasic(String courseID, String courseName,
			int headCredit, int tailCredit, int credit, int semester,
			String campus, String collegeID, String majorID, int maxStudentNum) {
		// TODO Auto-generated method stub
		if(courseID.equals(null)||courseName.equals(null)||campus.equals(null)
				||collegeID.equals(null)||majorID.equals(null)){
			return CourseProduceRM.INFO_BLANK;
		}
		else if(headCredit<tailCredit||tailCredit<=0||credit>headCredit||credit<tailCredit){
			return CourseProduceRM.CREDIT_EXCEPTION;
		}
		else if(maxStudentNum<=0){
			return CourseProduceRM.STUDENTNUM_EXCEPTION;
		}
		else if(semester<=0){
			return CourseProduceRM.SEMESTER_EXCEPTION;
		}
		return CourseProduceRM.SUCCESS;
	}

	@Override
	public CourseBasicVO getCourseBasic(String courseID) {
		// TODO Auto-generated method stub
		if(courseID.equals(courseBasicVO.getCourseBasicPO().getCourseId())){
			return courseBasicVO;
		}
		return null;
	}

	@Override
	public CourseProduceRM addCoursePublish(String courseID, String teacherID,
			String time, String location) {
		// TODO Auto-generated method stub
		if(courseID.equals(null)||teacherID.equals(null)||time.equals(null)||location.equals(null)){
			return CourseProduceRM.INFO_BLANK;
		}
		return CourseProduceRM.SUCCESS;
	}

	@Override
	public CourseProduceRM updateCoursePublish(String courseID, String teacherID,
			String time, String location) {
		// TODO Auto-generated method stub
		if(courseID.equals(null)||teacherID.equals(null)||time.equals(null)||location.equals(null)){
			return CourseProduceRM.INFO_BLANK;
		}
		return CourseProduceRM.SUCCESS;
	}

	@Override
	public CoursePublishVO getCoursePublish(String courseID) {
		// TODO Auto-generated method stub
		return coursePublishVO;
	}

	@Override
	public CourseProduceRM addCourseAssist(String courseID,
			String courseOutline, String textbook, String referenceBook) {
		// TODO Auto-generated method stub
		if(courseID.equals(null)||courseOutline.equals(null)||textbook.equals(null)
				||referenceBook.equals(null)){
			return CourseProduceRM.INFO_BLANK;
		}
		return CourseProduceRM.SUCCESS;
	}

	@Override
	public CourseProduceRM updateCourseAssist(String courseID,
			String courseOutline, String textbook, String referenceBook) {
		// TODO Auto-generated method stub
		if(courseID.equals(null)||courseOutline.equals(null)||textbook.equals(null)
				||referenceBook.equals(null)){
			return CourseProduceRM.INFO_BLANK;
		}
		return CourseProduceRM.SUCCESS;
	}

	@Override
	public CourseAssistVO getCourseAssist(String courseID) {
		// TODO Auto-generated method stub
		return courseAssistVO;
	}

}
